func <%= prefix %><%= resource_name %><%= titlelize(api.name) %>(d *schema.ResourceData, opts map[string]interface{}, arrayIndex map[string]int, client *golangsdk.ServiceClient) error {
<% url_v = "url" -%>
<% if api.path.include?("{") -%>
    url, err = replaceVars(d, "<%= api.path -%>", nil)
    if err != nil {
        return err
    }
<% else -%>
<%   url_v = sprintf("\"%s\"", api.path) -%>
<% end -%>
    url = client.ServiceURL(<%= url_v %>)

    params := make(map[string]interface{})
<%= lines(build_expand_properties(resource, api.parameters, "api", "opts, arrayIndex", resource_name + titlelize(api.name), "params", false), 1) %>

    r := golangsdk.Result{}
    _, r.Err = client.<%= api.verb.capitalize %>(url, &params, &r.Body, &golangsdk.RequestOpts{
        OkCodes: successHTTPCodes,
    })
    if r.Err != nil {
        return fmt.Errorf("Error run <%= api.name %>: %s", r.Err)
    }
    return nil
}
